Skip to content

fix(flow-chat): stabilize pinned turns and viewport diagnostics - #1846

Merged
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2
Jul 29, 2026
Merged

fix(flow-chat): stabilize pinned turns and viewport diagnostics#1846
wsp1911 merged 1 commit into
GCWing:mainfrom
wsp1911:dev2

Conversation

@wsp1911

@wsp1911 wsp1911 commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve the visible viewport range after users scroll away from a pinned latest turn.
  • Atomically settle tool-card collapse reservations while retaining semantic header anchors.
  • Prevent footer reservation clear-and-reacquire flashes and later unsignaled shrink drops.
  • Add opt-in Flow Chat diagnostics that write bounded JSONL batches to flowchat.log.
  • Coalesce concurrent flush requests and preserve monotonic sequence ordering after dropped events.
  • Add localized settings, stability documentation, and focused regression coverage.

Fixes #

Type and Areas

Type:

Regression fix / feature / test / docs

Areas:

Web UI, desktop/Tauri, configuration, logging, Flow Chat

Motivation / Impact

Pinned user messages could visibly flash or permanently drop after the user
navigated during streaming output. Automatic tool-card collapses could also
release footer compensation before the semantic anchor recovered.

This change gives transferred viewport range an explicit protected lifetime and
settles collapse compensation atomically to the minimum range required to retain
the current scroll position.

For continued investigation, users can enable Flow Chat viewport diagnostics in
logging settings. Diagnostics are disabled by default and write to a separate,
rotated flowchat.log only while enabled.

Verification

  • pnpm run lint:web
  • pnpm run type-check:web
  • pnpm run i18n:audit
  • pnpm --dir src/web-ui run test:run src/flow_chat/components/modern/VirtualMessageList.session-boundary.test.tsx src/flow_chat/components/modern/FlowChatViewportCoordinator.test.ts
    • 36 tests passed
  • pnpm --dir src/web-ui run test:run src/infrastructure/diagnostics/flowChatDiagnostics.test.ts
    • 4 tests passed
  • cargo check -p bitfun-desktop --tests
  • Focused desktop logging writer, remote workspace policy, and configuration default tests passed.
  • git diff --check

Manual verification:

  • Confirmed pinned messages remain stable after user scrolling during streaming.
  • Confirmed automatic tool-card collapses retain their header position.
  • Confirmed the previously observed end-of-turn drop no longer reproduces.

Reviewer Notes

  • app.logging.flow_chat_diagnostics defaults to false.
  • Disabled probes do not evaluate diagnostic payloads.
  • The append command is local-only.
  • Logs rotate at 10 MB with two backups.
  • The frontend queue is bounded and uses a single drain Promise.
  • Dropped-event markers retain monotonic sequence ordering and include the dropped range.
  • No migration is required.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

- Preserve protected footer range when users leave pinned turns or tool cards collapse.
- Atomically settle semantic anchors to prevent flashes and permanent viewport drops.
- Add opt-in bounded Flow Chat diagnostics with local JSONL rotation.
- Coalesce diagnostic writes and keep dropped-event sequences ordered.
- Add focused regression tests and update settings, locales, and documentation.
@wsp1911
wsp1911 merged commit a0ed699 into GCWing:main Jul 29, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant